Repository navigation
Conversation
…ot the default one
Every `#[test]` in this crate that makes a D3D12 device goes through `host()`, which
called `D3D12CreateDevice(None, ..)` - "Windows' default card". On a machine whose
monitor hangs off the motherboard that is the integrated chip, so the tests ran there:
* `pipeline::places`' children print the vendor of the device they made, and on a
7800X3D + RTX 4090 they printed `vendor=1002` (AMD's) and `not an NVIDIA card`;
* `dlss_starts_on_this_card` asked that Radeon whether it can start DLSS, got
`FeatureNotSupported` - correct for it - and read as a statement about the 4090.
Neither could be seen on CI, where the runner has one adapter and it is the right one.
Outside `cfg(test)` nothing changes: `test_adapter()` returns `None` and the runtime
keeps choosing as it did (`LEONIDA_ADAPTER`, else the default card). In a test build it
picks the adapter with the most `DedicatedVideoMemory` that is not software - the card a
game would be run on, whatever its vendor.
Measured on `main` 1fff691 + this change, RTX 4090 / driver 621.24:
cargo test -p leonida-gpu --lib -- --test-threads=1
644 passed; 0 failed; 59 ignored (on the iGPU: 653 passed, 1 failed)
cargo clippy -p leonida-gpu --all-targets 1 warning, host.rs:7628, on main already
**The one that failed on the iGPU and passes here** is
`descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` - the "copied as
it was made" byte comparison, reported in ProjectLeonida#2570 as a failure on an RTX 4090 by me. It is
not: it is a failure on the AMD iGPU, and ProjectLeonida#2975 (the functional test added beside it)
describes it wrongly for the same reason.
**Separately, and not caused by this change**: with the tests on the card, 4 of the 8
`#[ignore]`d `pipeline::places` tests fail on 621.24 (they pass vacuously on an iGPU,
which is how this went unnoticed). Those are the driver's behaviour, not this diff; they
are reported on their own.
Written with an AI assistant.
|
The places child can still create its early root signatures on a different adapter from the one whose sampler table it later examines. In the existing sequence At 2e2e163 I added temporary GetAdapterLuid logging to those two points and ran the child with diagnostics:
The WARP override makes the split reproducible on a single physical GPU. On a hybrid machine where default and highest-VRAM adapters differ, the same code paths can split without the override. The child reports only the host vendor today. Could both creation sites share adapter selection while preserving the required pre-host ordering? This affects how the reported places failures can be interpreted; I did not reproduce the four 4090 failures here. Codex-assisted. |
andrew-ai measured the places child making its early root signatures on the card's LUID while \host\ went to the Microsoft Basic Render Driver once LEONIDA_D3D12_WARP was set: two devices in one run, where the test's premise is that they are one. \ est_adapter()\ now returns None when that switch is on, so nothing is preferred and the switch means what it says. Verified that it changes nothing otherwise: the suite is 644 passed / 0 failed with the card, as before.
|
You are right, and thanks for instrumenting it rather than guessing. A run whose Fixed at One thing I could not reproduce, and it may tell you something about the harness: in my runs with // pipeline/places/tests.rs:761-762
.env_remove("LEONIDA_ADAPTER")
.env_remove("LEONIDA_D3D12_WARP");
Measured at AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
|
Confirmed your observation about run(). My earlier reproduction invoked a_run directly. I reran both paths at 9e1e959 with the same diagnostics binary, make=20,21;host, and LEONIDA_D3D12_WARP=1 in the parent:
The wrapper strips the override as you said. The direct-child split persists because the pre-host make uses D3D12CreateDevice(None, ...) without calling test_adapter(), while host takes its explicit WARP branch before reaching test_adapter(). The new guard therefore does not change either measured path. The remaining question for hybrid systems is whether the Windows default adapter and the highest-VRAM test adapter have the same LUID during a normal run(). Logging both on the hybrid host would settle it. Codex-assisted. |
|
A run I cannot do, on the card you have, and it would settle something in #2919. The question: on driver 621.24 the On this branch ( What to report, whatever it says:
No test changes needed and it costs two minutes. If it fails the four, that is the answer: 616.92 behaves like 616.64 and 621.24 is the one that changed - and the four failing tests are asserting a driver that is gone, which is #2996's point. AI-assisted: yes - DeepSeek v4.1 (flash). Written with an AI assistant. |
The note of 2026-11-27 says the fault reproduces every time, on an RTX 4060 Ti with
driver 616.64, and `pipeline/places.rs` is built against it. On an RTX 4090 with
621.24 it does not, and the reason is not luck:
the_check_looks_at_every_kind_of_sampler, run "make=50;host;pipe=c:1,2p"
places: "same", wrong: 0, read: [1, 2] (the samplers it should read)
the_table_of_static_samplers
host: places 0 to 15 hold [0, 1, 2, 3, …, 15]
host;make=22,20,21: places 0 to 15 hold [0, 1, 2, 3, …, 15]
on 616.64: [22, 20, 21, 0, 1, …, 12]
Three samplers made first take no place in this list's table, so a list's samplers are
numbered within the list and another run's order cannot move them - which is the fault's
mechanism, gone.
Measured without the game, with the tests' device on that card (they use
`D3D12CreateDevice(None, ..)`, which on this machine is the Radeon iGPU - ProjectLeonida#2995).
Four of the eight #[ignore]d places tests now fail, and each is asserting 616.64; they are
named in the section so that the next person does not read the red as a regression.
Not settled, and said so in the section: whether it is per root signature, per pipeline or
per device with another rule, and it is one card.
Written with an AI assistant.
|
An explicit Radeon override also splits the places child across two real adapters. I added the same I also tried a local variant that moves the existing device creation into one helper, called both by |
|
On a PC with two discrete 8 GB cards, an RTX 3070 driving the display and a Radeon RX 580, the most-dedicated-memory pick lands on the RX 580. That card has no mesh shaders, so it can't run the runtime at all. Head
The test that fails is A suggestion, since the runtime refuses such a card anyway: the pick could skip adapters without the features the runtime needs (mesh shader tier, as Tested with the help of Claude Code (Claude Opus 5.5). |
test: the crate's device tests ask the card with memory of its own, not the default one
Every
#[test]in this crate that makes a D3D12 device goes throughhost(), whichcalled
D3D12CreateDevice(None, ..)- "Windows' default card". On a machine whosemonitor hangs off the motherboard that is the integrated chip, so the tests ran there:
pipeline::places' children print the vendor of the device they made, and on a7800X3D + RTX 4090 they printed
vendor=1002(AMD's) andnot an NVIDIA card;dlss_starts_on_this_cardasked that Radeon whether it can start DLSS, gotFeatureNotSupported- correct for it - and read as a statement about the 4090.Neither could be seen on CI, where the runner has one adapter and it is the right one.
Outside
cfg(test)nothing changes:test_adapter()returnsNoneand the runtimekeeps choosing as it did (
LEONIDA_ADAPTER, else the default card). In a test build itpicks the adapter with the most
DedicatedVideoMemorythat is not software - the card agame would be run on, whatever its vendor.
Measured on
main1fff691 + this change, RTX 4090 / driver 621.24:cargo test -p leonida-gpu --lib -- --test-threads=1
644 passed; 0 failed; 59 ignored (on the iGPU: 653 passed, 1 failed)
cargo clippy -p leonida-gpu --all-targets 1 warning, host.rs:7628, on main already
The one that failed on the iGPU and passes here is
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in- the "copied asit was made" byte comparison, reported in #2570 as a failure on an RTX 4090 by me. It is
not: it is a failure on the AMD iGPU, and #2975 (the functional test added beside it)
describes it wrongly for the same reason.
Separately, and not caused by this change: with the tests on the card, 4 of the 8
#[ignore]dpipeline::placestests fail on 621.24 (they pass vacuously on an iGPU,which is how this went unnoticed). Those are the driver's behaviour, not this diff; they
are reported on their own.
Written with an AI assistant.